package haemers.reflection.tests 
{
	import flash.utils.describeType;
	import haemers.reflection.data.vo.ArgVO;
	import nl.haemers.data.constants.ReflectionConstants;
	import nl.haemers.data.reflection.Args;
	import nl.haemers.data.reflection.IArg;
	import org.flexunit.Assert;
	/**
	 * ...
	 * @author Jonathan
	 */
	public class ArgsTest 
	{		
		private var _args:Args;
		
		/** Public methods **/
		[Before]
		public function setup() : void
		{
			_args = new Args(_argsXML);
		}
		
		[Test]
		public function testLookUp() : void
		{
			Assert.assertTrue(_args.hasArg(ReflectionConstants.ATTRIBUTE_NAME));
			Assert.assertNotNull(_args.getArg(ReflectionConstants.ATTRIBUTE_NAME));
			Assert.assertTrue(_args.getArg(ReflectionConstants.ATTRIBUTE_NAME) is IArg);
			
			Assert.assertTrue(_args.hasArg(ReflectionConstants.ATTRIBUTE_IGNORE));
			Assert.assertNotNull(_args.getArg(ReflectionConstants.ATTRIBUTE_IGNORE));
			Assert.assertTrue(_args.getArg(ReflectionConstants.ATTRIBUTE_IGNORE) is IArg);
			
			Assert.assertTrue(_args.hasArg(ReflectionConstants.PARAMS_NAME));
			Assert.assertNotNull(_args.getArg(ReflectionConstants.PARAMS_NAME));
			Assert.assertTrue(_args.getArg(ReflectionConstants.PARAMS_NAME) is IArg);
		}
		
		[After]
		public function teardown() : void
		{
			_args = null;
		}
		/** Getters & Setters **/
		
		/** Protected methods **/
		
		/** Private methods **/
		private var _argsXML:XML = new XML(
			<metadata name="Serialize">
			  <arg key="name" value="idNo"/>
			  <arg key="ignore" value="true"/>
			  <arg key="params" value="id,object,description"/>
			</metadata>
		)
	}

}